//
//  bleHeader.h
//  GPS
//
//  Created by  on 2018/7/2.
//  Copyright © 2018年 杨赛. All rights reserved.
//

#ifndef bleHeader_h
#define bleHeader_h

#pragma mark 1791 协议



#define CMD_TOTAL_DATA_1791 0x07
#define CMD_ECG_PPG_DATA_1791 0x16
#define CMD_ECG_PPG_STATUS_1791 0x96
#define CMD_PICTURE_OTA_DATA 0x97
#define CMD_SEND_HR 0x11
#define CMD_REALTIME_TEMPERATURE 0x1C
#define CMD_REALTIME_ContinuousTEMPERATURE 0x1D
#define CMD_REALTIME_TEMPERATURELIST 0x64//获取自动测量温度记录
#define CMD_REALTIME_HEARTRATE_LIST1791 0x66  ////获取定时心率检测结果（自动ECG/PPG测量保存的心率结果）1791
#define CMD_GESTURE_RECOGNITION 0x53
#define CMD_DEVICE_STATUS 0x51
#define CMD_DEVICE_STATUS_1 0x56
#define CMD_DEVICE_DONOTDISTURB 0x50
#define CMD_DEVICE_ECG_PPG 0x37
#define CMD_CX_ECG_PPG 0x39

#define CMD_SET_TIME 0x01
#define CMD_GET_TIME 0x41
#define CMD_SET_INFO 0x02
#define CMD_GET_INFO 0x42
#define CMD_SET_DEVICE_INFO 0x03
#define CMD_GET_DEVICE_INFO 0x04
#define CMD_SET_DEVICE_ID 0x05
#define CMD_STEP 0x09
#define CMD_STEP_END 0x0a
#define CMD_SET_GOAL 0x0B
#define CMD_GET_GOAL 0x4B
#define CMD_GET_BATTERY 0x13
#define CMD_GET_MAC 0x22
#define CMD_GET_VERSION 0x27
#define CMD_MCU 0x2E
#define CMD_FACTORY_RESET 0x12
#define CMD_MOTOR 0x36
#define CMD_SET_DEVICE_NAME 0x3D
#define CMD_GET_DEVICE_NAME 0x3E
#define CMD_SET_AUTO_HEART 0x2A
#define CMD_GET_AUTO_HEART 0x2B
#define CMD_AUTO_SPO2 0x29
#define CMD_SET_ALARM 0x23
#define CMD_GET_ALARM 0x57
#define CMD_SET_ANCS 0x30
#define CMD_GET_ANCS 0x5B
#define CMD_SET_ACTIVITY_TIME 0x25
#define CMD_GET_ACTIVITY_TIME 0x26
#define CMD_GET_TOTAL_STEP 0x51
#define CMD_GET_DETAIL_STEP 0x52
#define CMD_GET_DETAIL_SLEEP 0x53
#define CMD_GET_HEART 0x54
#define CMD_GET_SINGLE_HEART 0x55 //获取单次的心率数据

#define CMD_GET_SINGLE_TEMPRRATURE 0x65 //获取手动温度测量数据
#define CMD_GET_TEMPRRATURE_1963YH 0x62 //获取自动温度数据 和 1791 步数详细数据
#define CMD_GET_SPO2  0x60//获取手动测试血氧数据
#define CMD_GET_AUTO_SPO2  0x66//获取自动测试血氧数据  ////获取定时心率检测结果（自动ECG/PPG测量保存的心率结果）1791
#define CMD_GET_HRV 0x56
#define CMD_GET_ACTIVITY_DATA 0x5C //获取运动模式的数据
#define CMD_SET_ACTIVITY_MODE //设置运动模式
#define CMD_GET_GPS 0x5A 
#define CMD_PACKAGE_APP 0x17
#define CMD_PACKAGE_DEVICE 0x18
#define CMD_FUNCTION_MODE 0x16
#define CMD_ENTER_ACTIVITY_MODE 0x19
#define CMD_OTA_MODE 0x47
#define CMD_TAKEPHOTO_MODE 0x20
#define CMD_BACK_HOME 0x10
#define CMD_ECG_PPG_START 0x99
#define CMD_ECG_PPG_STOP 0x98
#define CMD_ECG_RECEIVE  0xaa
#define CMD_PPG_RECEIVE  0xab
#define CMD_PPG_ECG_RESULT  0x9c
#define CMD_PPG_HRV_RESULT  0x83
#define CMD_REALTIME_HR  0x19
#define CMD_BODY_FAT_DATA 0x5D
#define CMD_SOURCE_OTA_TOTAL 0x90
#define CMD_SOURCE_OTA_DETAIL 0x91

#define CMD_UNLOCK 0xB0
#define CMD_ECG_STORE_DATA 0x71
#define CMD_WEATHER 0x15

#define CMD_SOURCE_OTA2025_TOTAL 0x92
#define CMD_SOURCE_OTA2025_DETAIL 0x93

#define CMD_SET_BP_Calibration 0x87
#define CMD_GET_BP_Calibration 0x88

#define CMD_PPG_MEASUREMENT_RESULT 0x78
#define CMD_PPG_MEASUREMENT_DATA 0x3a
#define CMD_SOS 0xfe


#define CMD_ACTIVITYMODE 0xAC
#define CMD_SET_Menstruation_Info 0x1c  //设置月经周期你
#define CMD_SET_Pregnancy_Info 0x1e //设置怀孕周期




typedef NS_ENUM(NSInteger, DATATYPE) {
    GetDeviceTime = 0,
    SetDeviceTime = 1,
    GetPersonalInfo = 2,
    SetPersonalInfo = 3,
    GetDeviceInfo = 4,
    SetDeviceInfo = 5,
    SetDeviceID = 6,
    GetDeviceGoal = 7,
    SetDeviceGoal = 8,
    GetDeviceBattery = 9,
    GetDeviceMacAddress = 10,
    GetDeviceVersion = 11,
    FactoryReset = 12,
    MCUReset = 13,
    MotorVibration = 14,
    GetDeviceName = 15,
    SetDeviceName = 16,
    GetAutomaticHRMonitoring = 17,
    SetAutomaticHRMonitoring = 18,
    GetAlarmClock = 19,
    SetAlarmClock = 20,
    GetSedentaryReminder = 21,
    SetSedentaryReminder = 22,
    RealTimeStep = 23,
    TotalActivityData = 24,
    DetailActivityData = 25,
    DetailSleepData = 26,
    DynamicHR = 27,
    StaticHR = 28,
    ActivityModeData = 29,
    EnterActivityMode = 30,
    DeviceSendDataToAPP = 31,
    EnterTakePhotoMode = 32,
    StartTakePhoto = 33,
    StopTakePhoto = 34,
    BackHomeView = 35,
    HRVData = 36,
    GPSData = 37,
    FindMobilePhone = 38,
    Spo2Data = 39,
    SetSocialDistanceReminder = 40,
    GetSocialDistanceReminder = 41,
    RealtimeECGAndPPGData  = 42,
    RealtimeHR_1791 = 43,
    GestureRecognition = 44,
    CheckDeviceStatus = 45,
    DeviceStatus0 = 46,
    DeviceStatus1 = 47,
    GetAutomaticSpo2Monitoring = 48,
    SetAutomaticSpo2Monitoring = 49,
    TEMPERATUREStep_1791 = 50,
    ContinuousTEMPERATURE_1791 = 51,
    TEMPERATURELISTStep_1791 = 52,
    DONOTDISTURBStep_1791 = 53,
    DONOTDISTURBStep_ECG_PPG_1791 = 54,
    DONOTDISCMD_CX_ECG_PPG_1791 = 55,
    OTAMode  = 56,
    ECGWaveData = 57,
    ECGResult = 58,
    HRV_Data = 59,
    UnLockScreen =  60,
    LockScreen = 61,
    ClickUnLockScreen =  62,
    ClickLockScreen = 63,
    Set_BP_Calibration = 64,
    Get_BP_Calibration = 65,
    PPG_Mesurement_Result =  66,
    PPG_Mesurement_Data  = 67,
    SetWeather = 68,
    SOS  = 69,
    GetActivityMode = 70,
    SetActivityMode = 71,
    SetPregnancyInfo = 72,
    SetMenstruationInfo = 73,
    
    
    BedStatus_0x11_1911   =  150,
    DataError =  255
};



typedef NS_ENUM(NSInteger, DEVICE_INFO_TYPE_1963YH) {
    distanceUnit,
    timeUnit,
    wristOn,
    temperatureUnit,
    nightMode,
    totalANCS,
    detailANCS,
    baseHeartRate,
    brightnessLevel,
    watchFaceStyle,
    socialDistanceReminder,
    language
};




#endif /* bleHeader_h */
